package cn.edu.scau.cmi.zhuangziyuan.singleton;

import java.util.ArrayList;

public class Multipleton {
	private static final int N = 11;
	private static ArrayList<Multipleton> multipletons = new ArrayList<Multipleton>(N);
	private String name;
	private Multipleton(String name) {
		this.name = name;
	}
	
	public static ArrayList<Multipleton> addInstance(String name) {
		if(multipletons.size() < N) {
			Multipleton multipleton = new Multipleton(name);
			multipletons.add(multipleton);
		}
		return multipletons;
	}
	
	public static Multipleton getInstance(int n) {
		return multipletons.get(n);
	}
	
	public String getName() {
		return name;
	}
}